using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_Base_EmpMap : EntityTypeConfiguration<t_Base_Emp>
    {
        public t_Base_EmpMap()
        {
            // Primary Key
            this.HasKey(t => t.FItemID);

            // Properties
            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FEmail)
                .HasMaxLength(50);

            this.Property(t => t.FAddress)
                .HasMaxLength(255);

            this.Property(t => t.FPhone)
                .HasMaxLength(40);

            this.Property(t => t.FID)
                .HasMaxLength(50);

            this.Property(t => t.FBankAccount)
                .HasMaxLength(40);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            this.Property(t => t.FBrNO)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FNumber)
                .HasMaxLength(255);

            this.Property(t => t.FShortNumber)
                .HasMaxLength(80);

            this.Property(t => t.FMobilePhone)
                .HasMaxLength(50);

            this.Property(t => t.FModifyTime)
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("t_Base_Emp");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FGender).HasColumnName("FGender");
            this.Property(t => t.FBirthday).HasColumnName("FBirthday");
            this.Property(t => t.FEmail).HasColumnName("FEmail");
            this.Property(t => t.FAddress).HasColumnName("FAddress");
            this.Property(t => t.FPhone).HasColumnName("FPhone");
            this.Property(t => t.FID).HasColumnName("FID");
            this.Property(t => t.FDuty).HasColumnName("FDuty");
            this.Property(t => t.FDegree).HasColumnName("FDegree");
            this.Property(t => t.FHireDate).HasColumnName("FHireDate");
            this.Property(t => t.FLeaveDate).HasColumnName("FLeaveDate");
            this.Property(t => t.FEmpGroupID).HasColumnName("FEmpGroupID");
            this.Property(t => t.FItemDepID).HasColumnName("FItemDepID");
            this.Property(t => t.FBankID).HasColumnName("FBankID");
            this.Property(t => t.FBankAccount).HasColumnName("FBankAccount");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FBrNO).HasColumnName("FBrNO");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FDeleted).HasColumnName("FDeleted");
            this.Property(t => t.FDepartmentID).HasColumnName("FDepartmentID");
            this.Property(t => t.FEmpGroup).HasColumnName("FEmpGroup");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FShortNumber).HasColumnName("FShortNumber");
            this.Property(t => t.FIsCreditMgr).HasColumnName("FIsCreditMgr");
            this.Property(t => t.FCreditPeriod).HasColumnName("FCreditPeriod");
            this.Property(t => t.FCreditLevel).HasColumnName("FCreditLevel");
            this.Property(t => t.FProfessionalGroup).HasColumnName("FProfessionalGroup");
            this.Property(t => t.FOperationGroup).HasColumnName("FOperationGroup");
            this.Property(t => t.FJobTypeID).HasColumnName("FJobTypeID");
            this.Property(t => t.FAllotPercent).HasColumnName("FAllotPercent");
            this.Property(t => t.FCreditDays).HasColumnName("FCreditDays");
            this.Property(t => t.FCreditAmount).HasColumnName("FCreditAmount");
            this.Property(t => t.FOtherARAcctID).HasColumnName("FOtherARAcctID");
            this.Property(t => t.FOtherAPAcctID).HasColumnName("FOtherAPAcctID");
            this.Property(t => t.FPreARAcctID).HasColumnName("FPreARAcctID");
            this.Property(t => t.FPreAPAcctID).HasColumnName("FPreAPAcctID");
            this.Property(t => t.FMobilePhone).HasColumnName("FMobilePhone");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
        }
    }
}
